package com.yang.concurrency.chapter4;

/**
 * @Author: 血魔
 * @Date: Created in 15:28 2021/12/12
 * @Version: $
 */
public class DeamonThread02 {
    public static void main(String[] args) {
        Thread t = new Thread( ()->{
            Thread innerThread= new Thread(() -> {
                try{
                    Thread.sleep(100_1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            });

            innerThread.setDaemon(true);
            innerThread.start();
            try{
                Thread.sleep(1000);
                System.out.println("T thread finishe done.");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });
        t.setDaemon(true);
        t.start();
    }
}
